//
//  AddShoppingView.m
//  DA_V
//
//  Created by 中亿世联前台 on 15/4/24.
//  Copyright (c) 2015年 zhouhai. All rights reserved.
//

#import "AddShoppingView.h"
#import "InterFace.h"
#import "ProductInfoModel.h"
@implementation AddShoppingView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (void)layoutSubviews{
    [super layoutSubviews];
//    self.addShoppingNum.layer.borderColor = [UIColor grayColor].CGColor;
//    self.addShoppingNum.layer.borderWidth = 1.0;
    self.shoppingNum.layer.borderColor = LineColor.CGColor;
    self.shoppingNum.layer.borderWidth = 1.0;
//    self.subtractShopping.layer.borderColor = [UIColor grayColor].CGColor;
//    self.subtractShopping.layer.borderWidth = 1.0;
}
#pragma -makr 减商品
- (IBAction)subtractClick:(id)sender {
    int i = self.shoppingNum.text.intValue;
   
    i--;
    if (i<= 1) {
        i=1;
    }
    self.shoppingNum.text = [NSString stringWithFormat:@"%d",i];
}
#pragma -makr 加商品
- (IBAction)addShoppingClick:(id)sender {
    int i = self.shoppingNum.text.intValue;
    i++;
    self.shoppingNum.text = [NSString stringWithFormat:@"%d",i];
}

#pragma -mark 给商品价格／原价付值
- (void)setProductInfoData:(id)data{

    if ([[data class] isSubclassOfClass:[ProductInfoModel class]]) {
        ProductInfoModel *model = data;

        self.nowPrace.text = [NSString stringWithFormat:@"%.1f",model.OriginaPrice.floatValue];
//        self.oldPrace.text =[NSString stringWithFormat:@"¥%.1f",model.MarketPriceAmount.floatValue];
        self.title.text = model.ProductName;
        self.shoppingNum.text = @"1";
    }
    
}

#pragma -mark 修改
@end
